module outmux
		(CSn, SEL, DATA, Y);
input			CSn;
input	[3:0]	SEL;
input	[47:0]	DATA;
output	[7:0]	Y;

reg		[7:0]	DB;

assign			Y = (CSn)? 8'b1111_1111 : DB;

always @(SEL or DATA)
case (SEL)
	0: DB <= DATA[7:0];
	1: DB <= DATA[15:8];
	2: DB <= DATA[23:16];
	3: DB <= DATA[31:24];
	4: DB <= DATA[39:32];
	5: DB <= DATA[47:40];
	6: DB <= 8'b0;
	7: DB <= 8'b0;
	8: DB <= 8'b0;
	9: DB <= 8'b0;
	10: DB <= 8'b0;
	11: DB <= 8'b0;
	12: DB <= 8'b0;
	13: DB <= 8'b0;
	14: DB <= 8'b0;
	15: DB <= 8'b0;
	default: DB <= 8'b0;
endcase
endmodule